class Bike < ApplicationRecord
  belongs_to :user
  has_one :prop, class_name: BikeProp, dependent: :destroy
  accepts_nested_attributes_for :prop


  enum status: [:unlocked, :locked, :warning]

  def as_json
    super(except: [:out_id, :markLat, :markLng, :created_at, :updated_at]).merge(
        status: status_before_type_cast,
        lat: markLat,
        lng: markLng
    )
  end
end
